#!/bin/bash
# test1
# test1_create_metadata_index_and_objects_mapping=$(curl -s -w "%{http_code}" http://localhost:9200/metadata -XPUT \
#     -H 'Content-Type: application/json' \
#     -d '{
#             "mappings": {
#                 "properties": {
#                     "objects": {
#                         "type": "object",
#                         "properties": {
#                             "name": {"type": "keyword"},
#                             "version": {"type": "integer"},
#                             "size": {"type": "integer"},
#                             "hash": {"type": "keyword"}
#                         }
#                     }
#                 }
#             }
        
#         }')
 
# test2
#test2_get_metadata_index_and_objects_mapping=$(curl -s -w "%{http_code}" http://localhost:9200/metadata -XGET)

# test3
# test3_put_test3_without_hash=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3 -XPUT \
#     #-H 'Content-Type: application/json' \
#     -d '{this is object test3}'

#  )

# test4
# sha256=$(echo -n "this is object test3" |openssl dgst -sha256 -binary |base64)
# test4_put_test3_version1_with_hash=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this is object test3'

# )

#test4
# sha256=$(echo -n "this is object test3 version2" |openssl dgst -sha256 -binary |base64)
# test4_put_test3_version2_with_hash=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this is object test3 version2'

# )

#test5
# sha256=$(echo -n "this is object test3 version2" |openssl dgst -sha256 -binary |base64)
# echo $sha256
# test5_locate_test3_version2=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/locate/$sha256)


# sha256=$(echo -n "this is object test3" |openssl dgst -sha256 -binary |base64)
# echo $sha256
# sha256=$(echo $sha256 |sed 's/\//%2F/g')  #转义URL对象名字中的"/"  为 "%2F", 因为URL中的"/" 后半部分被丢弃，对象名字中不能有"/"，如果有则需要转义。
# test5_locate_test3_version1=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/locate/$sha256)

#test6
# test6_get_versions_es=$(curl -s -w "%{http_code}" http://localhost:9200/metadata/_search?sort=objects.name,objects.version&from=0&size=10&q=objects.name:test3)

#test7
# test7_get_all_versions=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/versions/)

#test8
# test8_get_test3_versions=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/versions/test3)


#test9
#test9_get_test3_version1=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3?version=1)  //fixme

#test10
#test10_get_test3_latest_version_es=$(curl -s -w "{http_code}" "http://localhost:9200/metadata/_search?q=name:test3&size=1&sort=version:desc") 

#test11
#test11_get_test3_latest_version=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3) 

#test12
#test12_delete_test3=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3 -XDELETE)

#test13
#test13_get_test3_versions_after_delete=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/versions/test3)

#test14
#test14_get_test3=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3) #404

#test15

#test15_get_test3_old_version1=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3?version=1)

#test16
#test16_get_test3_old_version2=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test3?version=2)

#test17
# sha256=$(echo -n "this object will have only 1 instance" |openssl dgst -sha256 -binary |base64)
# test17_put_objects_with_diffname_and_samecontent_1=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test4_1 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this object will have only 1 instance'
# )

# sha256=$(echo -n "this object will have only 1 instance" |openssl dgst -sha256 -binary |base64)
# test17_put_objects_with_diffname_and_samecontent_2=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test4_2 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this object will have only 1 instance'
# )

# #test18  
# test18_locate_=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/locate/aWKQ2BipX94sb+h3xdTbWYAu1yzjn5vyFG2SOwUQIXY=)

# #test19
# test19_put_object_with_wronghash=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test4_1 -XPUT \
#     -H 'Digest: SHA-256=incorrecthash' \
#     -d 'this object will have only 1 instance'
# )

# sha256=$(echo -n "this object will be separate to 4+2 shards" |openssl dgst -sha256 -binary |base64)
# test20_put_objects_with_EC4_2=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test5 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this object will be separate to 4+2 shards'
# )

# # test23
# test23_get_object_test5=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test5)

# # test24 定位
# sha256=$(echo -n "this object will be separate to 4+2 shards" |openssl dgst -sha256 -binary |base64)
# test24_locate_test5=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/locate/$sha256)

# test25 删除分片0和修改分片1内容，测试即时修复
# test35 get 版本数大于等于doc_count的对象，并将其打包在buckets中
# test35=$(curl  -s -w "%{http_code}" -X GET "http://localhost:9200/metadata/_search" \
#     -H "Content-Type: application/json" \
#     -d '{
#     "size": 0,
#     "aggs": {
#         "group_by_name": {
#             "terms": {
#                 "field": "name.keyword",
#                 "min_doc_count": 3
#             },
#             "aggs": {
#                 "min_version": {
#                     "min": {
#                         "field": "version"
#                     }
#                 }
#             }
#         }
#     }
# }')

# sha256=$(echo -n "this is object test8 version 1" |openssl dgst -sha256 -binary |base64)
# test36_put_test8_v1=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test8 -XPUT \
#     -H 'Digest: SHA-256='$sha256'' \
#     -d 'this is object test8 version 1'
# )


# sha256=$(echo -n "this is object test8 version 2-6" |openssl dgst -sha256 -binary |base64)
# for i in `seq 1 5`;do
#     test37_put_test8_v2_6=$(curl -s -w "%{http_code}" http://192.168.194.21:12345/objects/test8 -XPUT \
#         -H 'Digest: SHA-256='$sha256'' \
#         -d 'this is object test8 version 2-6'
#     )
# done






function run_test() {
    echo "=====================$2 [start]====================="
    response=$1

    http_code=${response: -3}  # Get the last 3 characters which contain the HTTP status code
    body=${response%???}       # Get all characters except the last 3

    if [ "$http_code" != "200" ]; then
        echo "[ERROR] Failed. HTTP Status: $http_code"
        echo "$body" | jq '.'    # Pretty print error response if jq is available
        echo "=====================$2 [end]====================="
        return 1
    else
        echo "[SUCCESS]"
        echo "$body" | jq '.'    # Pretty print error response if jq is available
        echo "=====================$2 [end]====================="
    fi

    
}

main() {

# 多版本 #
    #run_test "$test1_create_metadata_index_and_objects_mapping" "test1_create_metadata_index_and_objects_mapping"
    #run_test "$test2_get_metadata_index_and_objects_mapping" "test2_get_metadata_index_and_objects_mapping"
    #run_test "$test3_put_test3_version1_without_hash" "test3_put_test3_version1_without_hash"
    #run_test "$test4_put_test3_version2_with_hash" "test4_put_test3_version2_with_hash"
    #run_test "$test5_locate_test3_version2" "test5_locate_test3_version2"
    #run_test  "$test5_locate_test3_version1" "test5_locate_test3_version1"
    #run_test "$test6_get_versions_es" "test6_get_versions_es"
    #run_test "$test7_get_all_versions" "test7_get_all_versions"
    #run_test "$test8_get_test3_versions" "test8_get_test3_versions"
    #run_test "$test9_get_test3_version1" "test9_get_test3_version1"
    #run_test "$test10_get_test3_latest_version_es" "test10_get_test3_latest_version_es"
    #run_test "$test11_get_test3_latest_version" "test11_get_test3_latest_version"
    #run_test "$test12_delete_test3" "test12_delete_test3"
    #run_test "$test13_get_test3_versions_after_delete" "test13_get_test3_versions_after_delete" # 3 versions
    #run_test "$test14_get_test3" "test14_get_test3" #404
    #run_test "$test15_get_test3_old_version1" "test15_get_test3_old_version1"
    #run_test "$test16_get_test3_old_version2" "test16_get_test3_old_version2"
    
# 去重 #
    # run_test "$test17_put_objects_with_diffname_and_samecontent_1" "test17_put_objects_with_diffname_and_samecontent_1"
    # run_test "$test17_put_objects_with_diffname_and_samecontent_2" "test17_put_objects_with_diffname_and_samecontent_2"
    # run_test "$test18_locate_" "test18_locate_"
    # run_test "$test19_put_object_with_wronghash" "test19_put_object_with_wronghash" # 400 

# EC #
    #run_test "$test20_put_objects_with_EC4_2" "test20_put_objects_with_EC4_2"
    # test21 查看数据分片分布
    #ls /tmp/?/objects

    # [root@linhx dos_framework]# ls /tmp/?/objects
    # /tmp/1/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.5.wGW6r6pLkHAJC2GlYxfk45FdUTTv31c57INXIUjmhZ8='

    # /tmp/2/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.2.pV2SP%2Fi3jK9KGs5BtQS++TJEecq8Z7%2FYaUnSRPU1IX8='

    # /tmp/3/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.4.i8xiyIwSO2cRJwnmkO4ieUV9v26H6e8tu5Y%2F3Op%2F4zE='

    # /tmp/4/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.0.XVFHp5%2F5kZ89051XQo6UEkWW8OGzyXwLWS4Ln9f0Ncg='

    # /tmp/5/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.3.9cMmcwZQE+dlbz27iekkG2%2FL4raiYzUUSvcbfE9xUKw='

    # /tmp/6/objects:
    # 'MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8=.1.DjgCAigrm%2FBMDzVlPdjPp+LZMHY9ktSKNX9A9eQShAQ='

    #查看数据分片.0-.3内容, 注意分片id 与数据服务节点随机性，根据ls /tmp/?/objects确定
    # test22 查看分片内容
    # cat /tmp/4/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.0.XVFHp5%2F5kZ89051XQo6UEkWW8OGzyXwLWS4Ln9f0Ncg\=      #this object
    # cat /tmp/6/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.1.DjgCAigrm%2FBMDzVlPdjPp+LZMHY9ktSKNX9A9eQShAQ\=      # will be se
    # cat /tmp/2/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.2.pV2SP%2Fi3jK9KGs5BtQS++TJEecq8Z7%2FYaUnSRPU1IX8\=    #parate to 4
    # cat /tmp/5/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.3.9cMmcwZQE+dlbz27iekkG2%2FL4raiYzUUSvcbfE9xUKw\=      #+2 shards

    # test23 get object
    #run_test "$test23_get_object_test5" "test23_get_object_test5"

    # test24 locate test5
    #run_test "$test24_locate_test5" "test24_locate_test5"

    # test25 删除分片0和修改分片1内容，测试即时修复（冗余内）
    #rm /tmp/4/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.0.XVFHp5%2F5kZ89051XQo6UEkWW8OGzyXwLWS4Ln9f0Ncg\=
    #echo some_garbage >/tmp/6/objects/MBMxWHrPMsuOBaVYHkwScZQRyTRMQyiKp2oelpLZza8\=.1.DjgCAigrm%2FBMDzVlPdjPp+LZMHY9ktSKNX9A9eQShAQ\=
    #run_test "$test23_get_object_test5" "test23_get_object_test5_after_fix"

# 断点续传#
    # test 26 测试
    #dd if=/dev/urandom of=/tmp/file bs=1000 count=100
    # sha256=$(openssl dgst -sha256 -binary /tmp/file |base64)
    # test26_resume_put_objects=$(curl -v http://192.168.194.21:12345/objects/test6 -XPOST \
    # -H 'Digest: SHA-256='$sha256'' \
    # -H 'Size: 100000' 
    # )
    # # test27 测试head
    # location="eyJOYW1lIjoidGVzdDYiLCJTaXplIjoxMDAwMDAsIkhhc2giOiJNZkdpMGhpMjhEbkJPUklPUzgyMm5KY2F6MGFiU2l4ZFpLWXRka0d1WTNJPSIsIlNlcnZlcnMiOlsiMTkyLjE2OC4xOTQuMTU6MTIzNDUiLCIxOTIuMTY4LjE5NC4xMToxMjM0NSIsIjE5Mi4xNjguMTk0LjE0OjEyMzQ1IiwiMTkyLjE2OC4xOTQuMTI6MTIzNDUiLCIxOTIuMTY4LjE5NC4xNjoxMjM0NSIsIjE5Mi4xNjguMTk0LjEzOjEyMzQ1Il0sIlV1aWRzIjpbImRhNTlhNWRmLWUyNjUtNDcxYS1iMGE1LTg1YjZmZTg4YmVhMCIsImE4MTgzYzcwLWY0YjgtNDUzNi05OWEyLTFlN2Y4NzRmNjU4NiIsIjAwNjI0ZTRiLTNkM2UtNGY4My04MjY5LWNkY2FhOGU2ZGIwMiIsIjVmMzNhMDMwLWJhMDctNDZlMi1hN2FiLWEyOGE5MjYzMjNiNCIsIjZjMzg2MWM0LTI5ZjgtNDYwYy1iMGE1LTEzYWJlZGMxYWMyZSIsIjg1MmQzNGVkLTI5ZWQtNGE5ZC1hOGM5LTQ1MWJhYjc1MTEyMSJdfQ=="
    # test27_head_object=$(curl -I http://192.168.194.21:12345/temp/$location)

    # # test28 测试PUT 50000字节
    # dd if=/tmp/file of=/tmp/first bs=1000 count=50
    # test28_PUT_first_half_of_object=$(curl -v -XPUT --data-binary @/tmp/first http://192.168.194.21:12345/temp/$location)

    # # test29 测试HEAD 查看实际上传数据量, 实际上传了32K
    # #location="eyJOYW1lIjoidGVzdDYiLCJTaXplIjoxMDAwMDAsIkhhc2giOiJNZkdpMGhpMjhEbkJPUklPUzgyMm5KY2F6MGFiU2l4ZFpLWXRka0d1WTNJPSIsIlNlcnZlcnMiOlsiMTkyLjE2OC4xOTQuMTU6MTIzNDUiLCIxOTIuMTY4LjE5NC4xMToxMjM0NSIsIjE5Mi4xNjguMTk0LjE0OjEyMzQ1IiwiMTkyLjE2OC4xOTQuMTI6MTIzNDUiLCIxOTIuMTY4LjE5NC4xNjoxMjM0NSIsIjE5Mi4xNjguMTk0LjEzOjEyMzQ1Il0sIlV1aWRzIjpbImRhNTlhNWRmLWUyNjUtNDcxYS1iMGE1LTg1YjZmZTg4YmVhMCIsImE4MTgzYzcwLWY0YjgtNDUzNi05OWEyLTFlN2Y4NzRmNjU4NiIsIjAwNjI0ZTRiLTNkM2UtNGY4My04MjY5LWNkY2FhOGU2ZGIwMiIsIjVmMzNhMDMwLWJhMDctNDZlMi1hN2FiLWEyOGE5MjYzMjNiNCIsIjZjMzg2MWM0LTI5ZjgtNDYwYy1iMGE1LTEzYWJlZGMxYWMyZSIsIjg1MmQzNGVkLTI5ZWQtNGE5ZC1hOGM5LTQ1MWJhYjc1MTEyMSJdfQ=="
    # test29_head_object=$(curl -I http://192.168.194.21:12345/temp/$location)
    # # [root@linhx dos_framework]# curl -I http://192.168.194.21:12345/temp/$location
    # # HTTP/1.1 200 OK
    # # Content-Length: 32000
    # # Date: Sun, 22 Jun 2025 11:52:31 GMT

    # # test30 上传剩下数据 68K
    # dd if=/tmp/file of=/tmp/second bs=1000 skip=32 count=68
    # test30_PUT_second_half_of_object=$(curl -v -XPUT --data-binary @/tmp/second http://192.168.194.21:12345/temp/$location \
    #     -H "range: bytes=32000-"
    # )

    # # test31 对比数据
    # # [root@linhx dos_framework]# diff -s /tmp/output /tmp/file
    # # Files /tmp/output and /tmp/file are identical

    # curl -v -XGET http://192.168.194.21:12345/objects/test6 > /tmp/output
    # diff -s /tmp/output /tmp/file
    
    # # test32 使用range头部指定下载后68K数据
    # # [root@linhx dos_framework]# diff -s /tmp/second /tmp/output2
    # # Files /tmp/second and /tmp/output2 are identical

    # curl -v -XGET http://192.168.194.21:12345/objects/test6 \
    #     -H "range: bytes=32000-" > /tmp/output2
    # diff -s /tmp/output2 /tmp/second

# compress #
    # test33 测试压缩功能
    # dd if=/dev/zero of=/tmp/file bs=1M count=100
    # sha256=$(openssl dgst -sha256 -binary /tmp/file |base64)
    # test33_PUT_compressed_object=$(curl -v -XPUT --data-binary @/tmp/file http://192.168.194.21:12345/objects/test7 \
    #     -H 'Digest: SHA-256='$sha256'' 
    # )
    # ls -ltr /tmp/?/objects/IE* #每个分片25MB， 压缩成25KB
    #     # [root@linhx dos_framework]# ls -ltr /tmp/?/objects/IE*
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/1/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.0.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/4/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.1.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/6/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.2.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/5/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.3.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/2/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.4.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    #     # -rw-r--r--. 1 root root 25957 Jun 22 20:58 '/tmp/3/objects/IEkqTQ2E+L6xdn9mFiKfhdRMKCe2S9v7Jg7hL6EQng4=.5.OUw0XwsMY+5lJiemLu0GkkTTXE1RNOTwfU6rtRr9pH4='
    # curl -v http://192.168.194.21:12345/objects/test7 -o /tmp/output
    # diff -s /tmp/output /tmp/file

    # # test34 以压缩方式下载数据, 并加压对比数据
    # curl -v http://192.168.194.21:12345/objects/test7 -H "Accept-Encoding: gzip" -o /tmp/output2.gz
    # gunzip /tmp/output2.gz
    # diff -s /tmp/output2 /tmp/file
        # [root@linhx dos_framework]# diff -s /tmp/output /tmp/file
        # Files /tmp/output and /tmp/file are identical
# devops tools #
    #run_test "$test35" "test35"
    #echo "test36"
    # run deleteOldMetadata, 根据版本数量限定留存策略保留每个对象最新的5个版本
    #export ES_SERVER=localhost:9200;go run ../tools/deleteOldMetadata/deleteOldMetadata.go
    # [root@linhx deleteOldMetadata]# curl -v http://192.168.194.21:12345/versions/test8
    # *   Trying 192.168.194.21:12345...
    # * Connected to 192.168.194.21 (192.168.194.21) port 12345 (#0)
    # > GET /versions/test8 HTTP/1.1
    # > Host: 192.168.194.21:12345
    # > User-Agent: curl/7.76.1
    # > Accept: */*
    # >
    # * Mark bundle as not supporting multiuse
    # < HTTP/1.1 200 OK
    # < Date: Mon, 23 Jun 2025 16:06:19 GMT
    # < Content-Length: 470
    # < Content-Type: text/plain; charset=utf-8
    # <
    # {"Name":"test8","Version":20,"Size":32,"Hash":"66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA="}
    # {"Name":"test8","Version":21,"Size":32,"Hash":"66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA="}
    # {"Name":"test8","Version":22,"Size":32,"Hash":"66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA="}
    # {"Name":"test8","Version":23,"Size":32,"Hash":"66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA="}
    # {"Name":"test8","Version":24,"Size":32,"Hash":"66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA="}
    # * Connection #0 to host 192.168.194.21 left intact


    # test37 删除orphan objects， orphan: 孤儿，指已经没有任何元数据引用的对象，需要在每个节点都要执行deleteOrphanObject工具，注意调用了数据服务的deleteObject接口
    # result: 删除成功并且所有数据节点都将该hash对应的对象分片文件移动到了$STORAGE_ROOT/garbage目录
    # for i in $(seq 1 6);do
    #     STORAGE_ROOT=/tmp/$i LISTEN_ADDRESS=192.168.194.1${i}:12345 go run ../tools/deleteOrphanObject/deleteOrphanObject.go
    # done

    # rm -rf  /tmp/1/objects/66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA*
    # echo some_garbage >/tmp/2/objects/66WuRH0s0albWDZ9nTmjFo9JIqTTXmB6EiRkhTh1zeA=.*
    # export RABBITMQ_SERVER=amqp://test:test@localhost:5672/
    # export ES_SERVER=localhost:9200
    # STORAGE_ROOT=/tmp/2  go run objectScanner.go
    
}

main "$@"